<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:if test="usuario==null || usuario.cdUsuario == null">
	<s:set name="title" value="%{'Cadastrar novo usuário'}"/>
</s:if>
<s:else>
	<s:set name="title" value="%{'Atualizar usuário'}"/>
</s:else>

<html>
<head>
    <link href="<s:url value='../../../css/style.css'/>" rel="stylesheet" type="text/css"/>
     <style>
		body {	
			background-color: #e8eefa;
			font-family: Verdana;	
			font-size: 11px;	
			line-height: 1em;	
			color: #000000;
		}
    	td {
    		white-space:nowrap;
    	}
    </style>
   <title><s:property value="#title"/></title>
</head>

<script language="javascript" type="text/javascript">
function formSubmit(){
	document.forms[0].submit();
}
function formCancelar(){
	document.forms[0].action = "indexUsu.action";
	document.forms[0].submit();
}
</script>

<base>
<body>

<s:actionerror />
<s:actionmessage />

<center>
<s:form action="crudUsu_save" method="post">
<table width="400" cellpadding="0" cellspacing="0" border="0">
<tr>
	<td width="15" height="16" align="right"><img src="../../../images/box-form-top-left.gif"></td>
	<td height="16" align="right" background="../../../images/box-form-up.gif" style="background-repeat: repeat-x"></td>
	<td width="15" height="16" align="left"><img src="../../../images/box-form-top-right.gif"></td>
</tr>
<tr>
	<td width="15" align="right" background="../../../images/box-form-middle-left.gif" style="background-repeat: repeat-y"></td>
	<td style="background-color: #f6f8f7;" align="center">
		<table width="100%" cellpadding="2" cellspacing="0" border="0">
		<tr>
			<td colspan="2"><img src="../../../images/titulo-form-alterar-dados-usuario.gif"></td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<table height="20" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td style="color: #c33232;">
						<b><s:actionerror />
						<s:actionmessage /></b>
					</td>
				</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td align="center"><br />
			    <!-- FORMULÁRIO -->
			    <s:textfield name="usuario.nmUsuario" value="%{usuario.nmUsuario}" label="%{getText('label.usuario')}" size="20" cssClass="inputTexto"/>
			    <s:password name="usuario.passUsuario" value="%{usuario.passUsuario}" label="%{getText('label.usuario.senha')}" size="20" cssClass="inputTexto"/>
			    <s:textfield name="usuario.emailUsuario1" value="%{usuario.emailUsuario1}" label="%{getText('label.usuario.email')}" size="50" cssClass="inputTexto"/>
			    <s:select name="usuario.categoria.cdCategoria" value="%{usuario.categoria.cdCategoria}" label="%{getText('label.categoria')}" list="categorias" listKey="cdCategoria" listValue="nmCategoria" cssClass="inputTexto"/>
			
			    <s:hidden name="usuario.cdUsuario" value="%{usuario.cdUsuario}"/>
			    <!--<s:submit value="%{getText('botao.label.cadastrar')}"/>-->
			    <!--<s:submit value="%{getText('botao.label.cancelar')}" name="redirect-action:indexUsu"/>-->
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center"><br />
			    <!-- BOTÕES -->
			    <table width="160" cellpadding="3" cellspacing="0" border="0">
			    <tr>
			    	<td colspan="2" align="center"><img src="../../../images/button-separator.gif" style="cursor: pointer;" /></td>
			    </tr>
			    <tr>
			    	<td width="80" align="center"><img src="../../../images/botao-salvar.gif" style="cursor: pointer;" onclick="formSubmit();" /></td>
			    	<td width="80" align="center"><img src="../../../images/botao-cancelar.gif" style="cursor: pointer;" onclick="formCancelar();" /></td>
			    </tr>
			    </table>
			</td>
		</tr>
		</table>
	</td>
	<td width="15" align="left" background="../../../images/box-form-middle-right.gif" style="background-repeat: repeat-y"></td>
</tr>
<tr>
	<td width="15" height="16" align="right"><img src="../../../images/box-form-bottom-left.gif"></td>
	<td height="16" align="left" background="../../../images/box-form-bottom.gif" style="background-repeat: repeat-x"></td>
	<td width="15" height="16" align="left"><img src="../../../images/box-form-bottom-right.gif"></td>
</tr>
</table>
</s:form>
</center>

</body>
</html>